import { getMenu } from "../../utils/request"

const state ={
    menu:[]
}
const mutations={
    changeMenu(state,arr){
         state.menu =arr
    }
   
}
const actions={
    menuActions(context){
        getMenu({istree:true}).then(res=>{
          context.commit('changeMenu',res.data.list)
        })
    }
}
const getters={
    menu(state){
        return state.menu
    }
}

export default {
    state,
    mutations,
    actions,
    getters,
    namespaced:true
}